package com.example.teemor.es_demo.entity;

import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;

import java.time.LocalDateTime;

@Data
@EqualsAndHashCode(callSuper = false)
@ToString
public class UserBehaviorLog {
    private Long id;
    private Long userId;
    private String sessionId;
    private String eventType; // 'view', 'click', 'search', 'add_cart', 'purchase'
    private Long productId;
    private String category;
    private String searchKeyword;
    private String pageUrl;
    private String userAgent;
    private String ipAddress;
    private LocalDateTime timestamp;
    private LocalDateTime date;

    public enum EventType {
        VIEW("浏览"),
        CLICK("点击"),
        SEARCH("搜索"),
        ADD_CART("加购物车"),
        PURCHASE("购买");

        private final String description;

        EventType(String description) {
            this.description = description;
        }

        public String getDescription() {
            return description;
        }
    }
}